<?php

namespace tasks;

use herosphp\bean\Beans;
use payment\service\BankLogService;
use tasks\interfaces\ITask;
use herosphp\core\Loader;

Loader::import('tasks.interfaces.ITask', IMPORT_CLIENT);

/**
 * 定时抓取银行流水任务
 * @author yangjian102621@gmail.com
 * @version 1.0.0
 * @since 15-4-27
 */
class GrapBankLogTask implements ITask {

    /**
     * @var BankLogService
     */
    protected $service;

    public function __construct()
    {
        $this->service = Beans::get("payment.bankLog.service");
    }

    public function run()
    {
        //抓取所有用户前一天的附属账户流水
        $startDate = date('Ymd', strtotime('-1 day'));
        $endDate = date('Ymd');
        $this->service->addUserBankLogs(null, $startDate, $endDate);
        tprintOk("抓取银行流水完毕.");
    }

} 
